<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<head th:replace="common :: header"/>
	<th:block th:include="common :: ztree" />
</head>
<body class="hold-transition box box-main">
	<input id="treeId"   name="treeId"    type="hidden" th:value="${menu.menuId}"/>
	<input id="treeName" name="treeName"  type="hidden" th:value="${menu.menuName}"/>
	<div class="treeExpandCollapse">
		<a href="#" onclick="$.tree.expand()">展开</a> /
		<a href="#" onclick="$.tree.collapse()">折叠</a>
	</div>
	<div id="tree" class="ztree treeselect"></div>
	</div>
	<script th:src="@{/js/domor/domor.js}"></script>
	<script th:inline="javascript">
		$(function() {
			$.tree.init({
				url: "/system/menu/menuTreeData",
				expandLevel: 1,
				onClick : zOnClick
			});
		});
		
		function zOnClick(event, treeId, treeNode) {
		    var treeId = treeNode.id;
		    var treeName = treeNode.name;
		    $("#treeId").val(treeId);
		    $("#treeName").val(treeName);
		}
	</script>
</body>
</html>
